//
//  ReaderBook.h
//  ebook
//
//  Created by 吴超飞 on 16/2/25.
//  Copyright © 2016年 Moton. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "Book.h"
#import "Bookmark.h"
#import "Chapter.h"
#import "ChapterContent.h"

@interface ReaderBook : NSObject

@property (nonatomic, retain) Book *book;
@property (nonatomic, retain) NSString *chapterId;//当前章的章节id
@property (nonatomic, retain) Chapter *chapter;//当前章(在章节列表中的对象)

@property (nonatomic, retain) ChapterContent *preChaptercontent;//上一章节
@property (nonatomic, retain) ChapterContent *currentChaptercontent;//当前章节
@property (nonatomic, retain) ChapterContent *nextChaptercontent;//下一章节
@property (nonatomic, retain) Chapter *preChapter;//当前章的前一章
@property (nonatomic, retain) Chapter *nextChapter;//当前章的后一章

@property (nonatomic, assign) NSInteger currentChapterIndex;
@property (nonatomic, assign) BOOL isFirstOrLastChapter;
@property (nonatomic, assign) float booknodePercent;//上次浏览章节位置百分比

@property (nonatomic, retain) NSMutableArray *chapterList;//章节列表

@property (nonatomic, retain) NSMutableArray *bookmarkList;//书签列表

-(void)setChapterList:(NSMutableArray *)chapterList complete:(void(^)(BOOL exist))complete;

//获取在章节列表中的对象
-(Chapter *)listChapter:(Chapter *)chapter;

//获取指定章节的前后章
-(Chapter *)chapterBefore:(Chapter *)chapter;
-(Chapter *)chapterAfter:(Chapter *)chapter;

@end
